Skip to content

Add alt_irk to RpPairingFile#87

Open
bitxeno wants to merge 1 commit intojkcoxson:masterfrom
bitxeno:pairing_file_irk
Open

Add alt_irk to RpPairingFile#87
bitxeno wants to merge 1 commit intojkcoxson:masterfrom
bitxeno:pairing_file_irk

Conversation

@bitxeno
Copy link
Copy Markdown
Contributor

@bitxeno bitxeno commented Apr 22, 2026

Why

The old pairing file contains the WiFiMACAddress field, allowing mDNS devices to find their paired pairing file based on the MAC address. However, the new RpPairingFile currently does not have a relevant field that allows mDNS devices to find their paired pairing file. The _remotepairing._tcp service only broadcasts the identifier and authTag data:

[+] name=4729F436-E44B-4A3A-A905-5EA48A25D28C type=_remotepairing._tcp ip=192.168.1.205 port=54096 txt=[identifier=4729F436-E44B-4A3A-A905-5EA48A25D28C authTag=4mobHidi ver=24 minVer=8 flags=0]

This PR adds an additional alt_irk field to the RpPairingFile to verify the identifier and authTag, achieving the same functionality. The verification algorithm is referenced as follows:
https://github.com/frida/frida-core/blob/main/src/fruity/pairing.vala#L1441C23-L1469

Approach

Add a small OPACK decoder so the pair-record save response can be parsed in-process, then validate the required peer fields before promoting them into a PeerDevice model. Persist alt_irk in RpPairingFile. PeerDevice use SipHash to validate remotepairing authTag values, while keeping the public API focused on the validated peer model instead of raw TLV parsing helpers.

How it works

RemotePairingClient::pair now parses the returned Info TLV into a validated PeerDevice and copies alt_irk into RpPairingFile. RpPairingFile now serializes and deserializes alt_irk. PeerDevice exposes validate_auth_tag for remotepairing service matching, and enables siphasher under the remote_pairing feature. The remote pairing module also adds OPACK decoding and TLV helpers for reading the peer info payload, plus unit tests that cover required peer fields and TLV parsing.

Validation:

cargo test -p idevice peer_device --lib --features remote_pairing,pair,core_device_proxy,tcp,tunnel_tcp_stack,rsd,xpc
cargo test -p idevice opack --lib --features remote_pairing,pair,core_device_proxy,tcp,tunnel_tcp_stack,rsd,xpc

Links

  • None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant